package com.blacktry.service.impl;

import com.blacktry.entity.model.Vo.Daily;
import com.blacktry.mapper.DailyMapper;
import com.blacktry.service.DailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class DailyServiceImpl implements DailyService {
    @Autowired
    DailyMapper dailyMapper;
    @Override
    public Map<String, Daily> selectdaily( String username,String time) {
        Map<String,Daily> b=new HashMap<>();
        List<Daily> a=dailyMapper.selectdaily(username,time);
        for(Daily c:a){
            if("1".equals(c.getLogicTime())){
                b.put("one",c);
            }
            if("2".equals(c.getLogicTime())){
                b.put("two",c);
            }
            if("3".equals(c.getLogicTime())){
                b.put("three",c);
            }
            if("4".equals(c.getLogicTime())){
                b.put("four",c);
            }
            if("5".equals(c.getLogicTime())){
                b.put("five",c);
            }

        }
        return b;

    }
}
